import { getTemplateConfig } from "@/config/template";
import openApiRequest from "@/utils/openApiRequest";

const config = getTemplateConfig();

export async function getFAQ(lang: string, params?: string) {
  const { packageCode, isSuperApp } = config;
  if (params && params.includes("product_key")) {
    return openApiRequest(
      `faq/v1/questions?lang=${lang}${params ? '&' + params : ''}${isSuperApp ? ('&package_code=' + packageCode) : ''}  `,
      {
        method: "GET",
        notAppId: isSuperApp,
      }
    );
  }
  return openApiRequest(`faq/v1/questions?lang=${lang}&${params}`, {
    method: "GET",
  });
}
